<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改公众号配置信息')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-wechatConfig-edit" th:object="${sysWechatConfig}">
            <input name="id" th:field="*{id}" type="hidden">

            <div class="form-group">
                <label class="col-sm-3 control-label is-required">环境：</label>
                <div class="col-sm-8">
                    <select class="form-control m-b" name="envType">
                        <option th:each="dict : ${activeProfiles}" th:text="${dict}"
                                th:value="${dict}"></option>
                    </select>
                </div>
            </div>
            
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">微信配置标识：</label>
                <div class="col-sm-8">
                    <input name="configCode" th:field="*{configCode}" class="form-control" type="text" required>
                </div>
            </div>

            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">微信appid：</label>
                <div class="col-sm-8">
                    <input name="appId" th:field="*{appId}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">微信 appsecret：</label>
                <div class="col-sm-8">
                    <input name="appsecret" th:field="*{appsecret}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">商户id：</label>
                <div class="col-sm-8">
                    <input name="mchId" th:field="*{mchId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">签名key：</label>
                <div class="col-sm-8">
                    <input name="signKey" th:field="*{signKey}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">证书地址：</label>
                <div class="col-sm-8">
                    <input name="certFile" th:field="*{certFile}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">token令牌：</label>
                <div class="col-sm-8">
                    <input name="token" th:field="*{token}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">消息加解密密钥：</label>
                <div class="col-sm-8">
                    <input name="encodingAesKey" th:field="*{encodingAesKey}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">创建日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="gmtCreate" th:value="${#dates.format(sysWechatConfig.gmtCreate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">更新日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="gmtModified" th:value="${#dates.format(sysWechatConfig.gmtModified, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "system/wechatConfig";
        $("#form-wechatConfig-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-wechatConfig-edit').serialize());
            }
        }

        $("input[name='gmtCreate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='gmtModified']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>